
from google.appengine.ext import db

class TraitModel(db.Model):
    name = db.StringProperty(required=True)
    label = db.StringProperty(required=True)
    type = db.StringProperty(required=True,
                             choices={"W", "A", "R"})
    effect = db.TextProperty(required=False)

class UnitTraitModel(db.Model):
    ref = db.StringProperty(required=True)
    rating = db.IntegerProperty(required=False)

def getUnitTraitModelKey(ref, rating):
    return ref + "_" + str(rating)